The present invention is related to performing operations in a programming language, and, more specifically to performing operations by a first functionality in a programming language within a second functionality in the programming language or in a different programming language.
According to the present invention, an architect console is utilized through which at least one proxy and adapter are provided to a selected source. The architect console analyzes source code, methods within classes that will be exposed are selected, and mapping and various generation options for those methods are provided. The analyzing allows a database of classes, methods, and fields to be built. Based on a received command, all of the proxies, adapters and streamers that will be needed to perform invocations (for example, remote invocations) are generated in an appropriate source language. For example, if a server associated with JAVA code whose functionality is to be exposed to a C++ client, then JAVA adapters are generated for the server, and C++ source code proxies are generated for the client.
Within the proxy of the present invention, initialization code, at least one proxy method, and at least one lookup method exist. The initialization code registers a type of that proxy within the run time, and registers method streamers used to marshal and unmarshal arguments, and return values passed during remote invocations. The proxy methods have the same signature as the business method of the object that is being exposed. As such, the client “believes” that it is accessing the business object directly but it is really invoking the business object through the proxy. The lookup method is called by the client in order to acquire a proxy that is found in a naming service.
Within the adapter of the present invention, at least one bind method, and an invoke method, exist. The bind method can be called to register an adapter in the naming service, while the invoke method, which will be called by the run time, will dispatch the invocation to the appropriate business method.
A problem exists in the current art of effectively and efficiently acquiring an initial remote reference to a remote object. In order to do so, the present invention comprises a naming service that binds an object into a well known name, and a client that uses that well known name to acquire a proxy to the object in as few steps as possible.